<template>
  <div>
    <div class="top-com">
      <top-title></top-title>
      <quo-title :middle="midtitle" :name="person.personName"></quo-title>
      <Search v-on:ifshow="change(isShow)"></Search>
      <select-contain v-if="isShow" v-on:btn="selectquo"></select-contain>
    </div>
    <div class="contain-com">
      <quo-list :quotions="quos" :person="person"></quo-list>
    </div>
    <div>
      <bottom-buton :butcon="buttonContent"></bottom-buton>
    </div>
  </div>
</template>

<script>
import topTitle from "../../components/topTitle";
import quoTitle from "../../components/quoTitle";
import Search from "../../components/Search";
import quoList from "../../components/quoList";
import selectContain from "../../components/selectContain";
import bottomButon from "../../components/bottomButon";
import {selectQuo} from "../../main";

export default {
  name: "postQuoList",
  components:{
    topTitle,
    quoTitle,
    Search,
    quoList,
    selectContain,
    bottomButon
  },
  data(){
    return{
      midtitle:'全部项目',
      buttonContent:'添加工单',
      isShow:false,
      quotions:this.$route.query.list,
      person:this.$route.query.person,
      quos:this.$route.query.list,
    }
  },
  methods:{
    change: function(isShow){
      this.isShow = !isShow
      console.log(this.$route.query.person);
    },
    selectquo:function (sta){
      let quotes = []
      for(let i in this.quotions){
        if (this.quotions[i].state == sta){
          quotes.push(this.quotions[i])
        }
      }
      this.isShow = false
      this.quos = quotes
    }
  }
}
</script>

<style scoped>

</style>
